<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>文档列表 - 光年(Light Year Admin)后台管理系统模板</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="${pageContext.servletContext.contextPath}/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.servletContext.contextPath}/admin/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${pageContext.servletContext.contextPath}/admin/css/style.min.css" rel="stylesheet">
    <!-- CSS only -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css"
          integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    <!-- JS, Popper.js, and jQuery -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"
            integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
            integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js"
            integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
            crossorigin="anonymous"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
    <script src="${pageContext.servletContext.contextPath}/admin/js/admin/userList.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">
                    <form class="pull-right search-bar" method="get" action="#!" role="form">
                        <div class="input-group">
                            <div class="input-group-btn">
                                <input type="hidden" name="search_field" id="search-field" value="title">
                                <button class="btn btn-default dropdown-toggle" id="search-btn" data-toggle="dropdown"
                                        type="button" aria-haspopup="true" aria-expanded="false">
                                    标题 <span class="caret"></span>
                                </button>
                            </div>
                            <input type="text" class="form-control" value="" name="keyword" id="keyword"
                                   onblur="QueryUserByName()" placeholder="请输入用户名字或者账户查询">
                        </div>
                    </form>
                    <div class="toolbar-btn-action">
                        <a class="btn btn-primary m-r-5" href="#" data-toggle="modal" data-target="#staticBackdrop"><i
                                class="mdi mdi-plus"></i> 新增</a>
                        <%--对用户登录进行管理--%>
                        <%--                        <a class="btn btn-success m-r-5" href="#" disabled=""><i class="mdi mdi-check"></i> 启用</a>--%>
                        <%--                        <a class="btn btn-warning m-r-5" href="#" disabled=""><i class="mdi mdi-block-helper"></i> 禁用</a>--%>
                        <a class="btn btn-danger" href="#" onclick="admin_checked()"><i
                                class="mdi mdi-window-close"></i> 删除</a>
                    </div>
                </div>
                <div class="card-body">

                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>
                                    <label class="lyear-checkbox checkbox-primary">
                                        <input type="checkbox" id="check-all"><span></span>
                                    </label>
                                </th>
                                <th>用户ID</th>
                                <th>用户名字</th>
                                <th>用户密码</th>
                                <th>用户权限</th>
                                <th>用户创建时间</th>
                                <th>用户账户</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="tbody" style="font-weight: bolder">

                            </tbody>
                        </table>

                    </div>
                    <%--                    页码--%>
                </div>
                <%--                        拟态框--%>
                <!-- Button trigger modal -->

                <!-- Modal -->
                <div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1"
                     role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="staticBackdropLabel"
                                    style="font-weight: bolder;font-size: 20px">添加一条数据</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <form>
                                    <div class="row">
                                        <div class="col">
                                            <label>
                                                <input id="userName" onblur="admin_checkUserName()" required type="text"
                                                       class="form-control" placeholder="用户名字">
                                            </label>
                                        </div>
                                        <div class="col">
                                            <label>
                                                <input id="userPassword" type="text" class="form-control" required
                                                       onblur="admin_checkUserPassword()"
                                                       placeholder="用户密码">
                                            </label>
                                        </div>
                                        <div class="col">
                                            <label>
                                                <input id="userAccount" type="text" class="form-control" required
                                                       onblur="admin_checkUseraccount()" placeholder="用户账户">
                                            </label>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button id="close" type="button" class="btn btn-secondary" data-dismiss="modal"
                                        style="background-color: white;color: black;font-weight: bolder">关闭
                                </button>
                                <button id="sumbit" type="button" class="btn btn-primary"
                                        style="background-color: #33cabb;color: white;font-weight: bolder"
                                        onclick="commit_result()">提交
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <%--修改的拟态框--%>
                <div class="modal fade" id="alter" data-backdrop="static" data-keyboard="false" tabindex="-1"
                     role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title"
                                    style="font-weight: bolder;font-size: 20px">修改一条数据</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <form>
                                    <div class="row">
                                        <div class="col">
                                            <label>
                                                <input id="alter_userName" onblur="admin_checkUserName()" required type="text"
                                                       class="form-control" placeholder="用户名字">
                                            </label>
                                        </div>
                                        <div class="col">
                                            <label>
                                                <input id="alter_userPassword" type="text" class="form-control" required
                                                       onblur="admin_checkUserPassword()"
                                                       placeholder="用户密码">
                                            </label>
                                        </div>
                                        <div class="col">
                                            <label>
                                                <input id="alter_userAccount" type="text" class="form-control" required
                                                       onblur="admin_checkUseraccount()" placeholder="用户账户">
                                            </label>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button id="alter_close" type="button" class="btn btn-secondary" data-dismiss="modal"
                                        style="background-color: white;color: black;font-weight: bolder">关闭
                                </button>
                                <button id="alter_sumbit" type="button" class="btn btn-primary"
                                        style="background-color: #33cabb;color: white;font-weight: bolder"
                                        onclick="commit_result()">提交
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>

</div>

<script type="text/javascript" src="${pageContext.servletContext.contextPath}/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.servletContext.contextPath}/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.servletContext.contextPath}/admin/js/main.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.search-bar .dropdown-menu a').click(function () {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>